package com.tyust.dao;

import org.junit.Test;

import java.util.zip.CheckedOutputStream;

import static org.junit.Assert.*;

public class UserDaoTest {
    UserDao userDao=new UserDao();
    @Test
    public void insertUser(){
        int flag=userDao.insertUser("wanxiaoshuai1","niubi");
        if(flag==1){
            System.out.println("注册成功");
        }else{
            System.out.println("注册失败");
        }
    }

    @Test
    public void login() {
        boolean flag=userDao.login("wanxiaoshuai","niubi");
        if(flag==true){
            System.out.println("登录成功");
        }else{
            System.out.println("登录失败");
        }
    }

    @Test
    public void deleteUser() {
        int flag=userDao.deleteUser(1);
        System.out.println(flag);
    }

    @Test
    public void updateUser() {
        int flag=userDao.updateUser(2,"niubi","niubi");
        System.out.println(flag);
    }

    @Test
    public void selectAllUser() {
        System.out.println(userDao.selectAllUser());
    }
}






